from myelin.Ns import MYELIN, DC, DCTERMS
from myelin.rdf.Ns import SW_VOCAB_STATUS as VS
from myelin.rdf.Ns import RDFS
from myelin.rdf.bindery.ObjectTypes import ResourceTypeO, LiteralTypeO

from Resource import Resource

from ObjectTypes import \
    VocabSchemaTypeO, VocabSchemaTypeS, \
    OntologyTypeO, UserAgentTypeO

from mappings import \
    DocumentMap, RelationsMap, \
    SchemaMap, SchemaRelationsMap


class VocabSchema(Resource):
    
    ModelTypes = (VocabSchemaTypeO, VocabSchemaTypeS)
    
    RDF_BINDINGS = {
        
        'dcTitle'           : ((DC, 'title'), LiteralTypeO, DocumentMap),
        'dcCreator'         : ((DC, 'creator'), UserAgentTypeO, DocumentMap),
        'dcLanguage'        : ((DC, 'language'), LiteralTypeO, DocumentMap),
        'dcDescription'     : ((DC, 'description'), LiteralTypeO, DocumentMap),
        'dcSubject'         : ((DC, 'subject'), LiteralTypeO, DocumentMap),
        'dcDate'            : ((DC, 'date'), LiteralTypeO, DocumentMap),
        'dcPublisher'       : ((DC, 'publisher'), ResourceTypeO, DocumentMap),    
        
        'dctermsCreated'    : ((DCTERMS, 'created'), LiteralTypeO, DocumentMap),
        'dctermsModified'   : ((DCTERMS, 'modified'), LiteralTypeO, DocumentMap),
        
        'dctermsIsReferencedBy'     : ((DCTERMS, 'isReferencedBy'), ResourceTypeO, RelationsMap),
        'dctermsIsRequiredBy'     : ((DCTERMS, 'isRequiredBy'), ResourceTypeO, RelationsMap),
        'dcType'            : ((DC, 'type'), ResourceTypeO, RelationsMap),
        'dcSource'          : ((DC, 'source'), ResourceTypeO, RelationsMap),
        
        'rdfsLabel'         : ((RDFS, 'label'), LiteralTypeO, SchemaMap),
        'rdfsComment'       : ((RDFS, 'comment'), LiteralTypeO, SchemaMap),
        'rdfsIsDefinedBy'   : ((RDFS, 'isDefinedBy'), OntologyTypeO, SchemaMap),
        'vsTerm_Status'     : ((VS, 'term_status'), LiteralTypeO, SchemaMap),        
    }
